package com.example.javafx.bilibilidownload.pojo;

import com.example.javafx.bilibilidownload.constant.BiliVideoEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.Objects;

import static com.example.javafx.bilibilidownload.util.BiliFileUtil.fileNameReplaceInvalidCharater;


@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
public class BiliVideoPojo {

    private static final long serialVersionUID = -2731598327218972274L;
    private String id;
    private int comment;//11822,
    private int typeid;//154,
    private int play;//24720282,
    private String pic;//private String http;////i1.hdslb.com/bfs/archive/e2a356b34e28feda14dcea93fb429a2c302aa95d
    // .jpgprivate String ,
    private String subtitle;//"",
    private String description;//private String 这一次，我终于拍到荷花了，夏天在荷花池边拍舞真的需要好运气呀，真幸运。\n
    // 这次的舞蹈是芒种，也是给大家的中秋礼物，希望大家看得开心，愿大家中秋快乐！\n\n音乐：芒种，音阙诗听\n编舞：白小白，av66178139private String ,
    private String copyright;//private String 1private String ,
    private String title;//private String 【欣小萌】芒种，一想到你我就……private String ,
    private String review;//0,
    private String success;//成功,
    private String author;//private String -欣小萌-private String ,
    private String mid;//8366990,
    private String created;//1568276257,
    private String length;//private String 03;//32private String ,
    private String video_review;//43022,
    private String aid;//67457647,
    private String bvid;//private String BV1sJ411P7CFprivate String ,
    private String hide_click;//false,
    private String is_pay;//0,
    private String is_union_video;//0,
    private String is_steins_gate;//0,
    private String is_live_playback;//0

    private String videoUrl;
    private String videoName;
    private String audioUrl;
    private String audioName;
    private String cid;
    private String page;
    // 视频下载信息
    private String videoContent;
    // 收藏时间
    private String favoriteTime;
    // 所属收藏夹名字
    private String favoriteName;
    // 所属收藏夹id
    private String favoriteId;
    // 所属合集名字
    private String collectionName;

    private Boolean canDownload;

    // 视频类型
    private String type;

    public Boolean getCanDownload() {
        return canDownload;
    }

    public void setCanDownload(Boolean canDownload) {
        this.canDownload = canDownload;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = fileNameReplaceInvalidCharater(title);
    }

    public String getCollectionName() {
        return collectionName;
    }

    public void setCollectionName(String collectionName) {
        this.collectionName = fileNameReplaceInvalidCharater(collectionName);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getComment() {
        return comment;
    }

    public void setComment(int comment) {
        this.comment = comment;
    }

    public int getTypeid() {
        return typeid;
    }

    public void setTypeid(int typeid) {
        this.typeid = typeid;
    }

    public int getPlay() {
        return play;
    }

    public void setPlay(int play) {
        this.play = play;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCopyright() {
        return copyright;
    }

    public void setCopyright(String copyright) {
        this.copyright = copyright;
    }

    public String getReview() {
        return review;
    }

    public void setReview(String review) {
        this.review = review;
    }

    public String getSuccess() {
        return success;
    }

    public void setSuccess(String success) {
        this.success = success;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getMid() {
        return mid;
    }

    public void setMid(String mid) {
        this.mid = mid;
    }

    public String getCreated() {
        return created;
    }

    public void setCreated(String created) {
        this.created = created;
    }

    public String getLength() {
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }

    public String getVideo_review() {
        return video_review;
    }

    public void setVideo_review(String video_review) {
        this.video_review = video_review;
    }

    public String getAid() {
        return aid;
    }

    public void setAid(String aid) {
        this.aid = aid;
    }

    public String getBvid() {
        return bvid;
    }

    public void setBvid(String bvid) {
        this.bvid = bvid;
    }

    public String getHide_click() {
        return hide_click;
    }

    public void setHide_click(String hide_click) {
        this.hide_click = hide_click;
    }

    public String getIs_pay() {
        return is_pay;
    }

    public void setIs_pay(String is_pay) {
        this.is_pay = is_pay;
    }

    public String getIs_union_video() {
        return is_union_video;
    }

    public void setIs_union_video(String is_union_video) {
        this.is_union_video = is_union_video;
    }

    public String getIs_steins_gate() {
        return is_steins_gate;
    }

    public void setIs_steins_gate(String is_steins_gate) {
        this.is_steins_gate = is_steins_gate;
    }

    public String getIs_live_playback() {
        return is_live_playback;
    }

    public void setIs_live_playback(String is_live_playback) {
        this.is_live_playback = is_live_playback;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public String getVideoName() {
        return fileNameReplaceInvalidCharater(videoName);
    }

    public void setVideoName(String videoName) {
        this.videoName = videoName;
    }

    public String getAudioUrl() {
        return audioUrl;
    }

    public void setAudioUrl(String audioUrl) {
        this.audioUrl = audioUrl;
    }

    public String getAudioName() {
        return audioName;
    }

    public void setAudioName(String audioName) {
        this.audioName = audioName;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    public String getVideoContent() {
        return videoContent;
    }

    public void setVideoContent(String videoContent) {
        this.videoContent = videoContent;
    }

    public String getFavoriteTime() {
        return favoriteTime;
    }

    public void setFavoriteTime(String favoriteTime) {
        this.favoriteTime = favoriteTime;
    }

    public String getFavoriteName() {
        return favoriteName;
    }

    public void setFavoriteName(String favoriteName) {
        this.favoriteName = favoriteName;
    }

    public String getFavoriteId() {
        return favoriteId;
    }

    public void setFavoriteId(String favoriteId) {
        this.favoriteId = favoriteId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BiliVideoPojo that = (BiliVideoPojo) o;
        return Objects.equals(title, that.title) && Objects.equals(aid, that.aid) && Objects.equals(bvid, that.bvid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(title, aid, bvid);
    }

    @Override
    public String toString() {
        return "BilibiliVideo{" + "title='" + title + '\'' + ", mid='" + mid + '\'' + ", aid='" + aid + '\'' + ", " +
                "bvid='" + bvid + '\'' + '}';
    }
}
